<?php
/**
 * Service.php
 * @copyright (c) 2011-2020, Hangzhou DOJI Tech Co., Ltd.
 * This is NOT a freeware, use is subject to license terms.
 * @package Service.php
 * @link https://www.tingjunapp.com/
 * @author wujun@lanqb.cn
 * @: Service.php 310000 2020-11-08 21:53:14 $
 * */

namespace App\Services;

/**
 * Class Service
 * @return Service
 * @package App\Services
 * #Service List:
 * @property AgreementService $AgreementService
 * @property ArticleService $ArticleService
 * @property AuthWxService $AuthWxService
 * @property CounterService $CounterService
 * @property CollectService $CollectService
 * @property ConfigService $ConfigService
 * @property CommentService $CommentService
 * @property DynamicService $DynamicService
 * @property HomeService $HomeService
 * @property IndustryService $IndustryService
 * @property InterService $InterService
 * @property JobService $JobService
 * @property LikeService $LikeService
 * @property LoginService $LoginService
 * @property LogLoginService $LogLoginService
 * @property LogCountService $LogCountService
 * @property MessageCountService $MessageCountService
 * @property MessageService $MessageService
 * @property NoteService $NoteService
 * @property OAuthService $OAuthService
 * @property PackageService $PackageService
 * @property ProCategoryService $ProCategoryService
 * @property ProService $ProService
 * @property QuickService $QuickService
 * @property RecommendSystemService $RecommendSystemService
 * @property RelationshipService $RelationshipService
 * @property ReplyService $ReplyService
 * @property ReportService $ReportService
 * @property SearchService $SearchService
 * @property ShareService $ShareService
 * @property SiteService $SiteService
 * @property SmsService $SmsService
 * @property SquareService $SquareService
 * @property UserService $UserService
 * @property FeedbackService $FeedbackService
 * @property SysAgreementService $SysAgreementService
 * @property SpiderService $SpiderService
 * @property SalonService $SalonService
 * @property TopicService $TopicService
 * @property TortService $TortService
 * @property UserRecommendService $UserRecommendService
 * @property LogSpiderService $LogSpiderService
 * @property NoteDataService $NoteDataService
 * @property BrowseHistoryService $BrowseHistoryService
 *
 * #Service end.
 */
class Service
{

    /**
     * Repository constructor.
     */
    public function __construct()
    {
        // construction
    }

    /**
     * Handle dynamic static method calls into the model.
     * @param string $method
     * @param array $parameters
     * @return mixed
     */
    public static function __callStatic($method, $parameters)
    {
        return (new static)->$method(...$parameters);
    }

    /**
     * Convert the model to its string representation.
     * @return string
     */
    public function __toString()
    {
        return json_encode($this);
    }

    /**
     * Get property in instance.
     * @param $property
     * @return mixed|null
     */
    public function __get($property)
    {
        if (isset($this->$property)) {
            return $this->$property;
        } else {
            $instance = 'App\\Services\\' . $property;
            $service  = new $instance();
            return $this->$property = $service;
        }
    }

    /**
     * Set property for instance.
     * @param $property
     * @param $value
     */
    public function __set($property, $value)
    {
        $this->$property = $value;
    }

    /**
     * Deny clone instance.
     * @return null
     */
    public function __clone()
    {
        return null;
    }


}
